﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CSP.Receipts.Business;
using CSP.Receipts.DataModel;
using Ninject;

namespace MySharpReceipts.Controllers
{
    public class BaseController : Controller
    {
        [Inject]
        public IUserRepository UserRepos { get; set; }
        [Inject]
        public IKernel Kernel { get; set; }

        public int PageSize
        {
            get { return 5; }
        }
        

        protected internal User CurrentUser
        {
            get
            {
                if (User.Identity.IsAuthenticated)
                    return UserRepos.GetOne(u => u.Username == User.Identity.Name);
                else
                    return null;
            }
        }
    }

    [Authorize]
    public class SecureBaseController : BaseController
    {
        
    }
}